﻿<UserControl x:Class="NullableNumericUpDownExample.MainPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
             xmlns:ilektrik="clr-namespace:NullableNumericUpDownExample.Classes"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="400">

    <Grid x:Name="LayoutRoot"
          Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0"
                   Grid.Column="0"
                   Height="23"
                   HorizontalAlignment="Center"
                   Name="textBlock1"
                   Text="int value:"
                   VerticalAlignment="Center" />
        <TextBlock Grid.Row="1"
                   Grid.Column="0"
                   Height="23"
                   HorizontalAlignment="Center"
                   Name="textBlock2"
                   Text="int value:"
                   VerticalAlignment="Center" />
        <TextBlock Grid.Row="2"
                   Grid.Column="0"
                   Height="23"
                   HorizontalAlignment="Center"
                   Name="textBlock3"
                   Text="double value:"
                   VerticalAlignment="Center" />
        <TextBlock Grid.Row="3"
                   Grid.Column="0"
                   Height="23"
                   HorizontalAlignment="Center"
                   Name="textBlock4"
                   Text="double? value:"
                   VerticalAlignment="Center" />

        <TextBlock Grid.Row="0"
                   Grid.Column="1"
                   Height="23"
                   HorizontalAlignment="Center"
                   Name="textBlock1value"
                   Text="{Binding Path=ValueIncubator.ValueInt,FallbackValue='Value int'}"
                   VerticalAlignment="Center" />
        <TextBlock Grid.Row="1"
                   Grid.Column="1"
                   Height="23"
                   HorizontalAlignment="Center"
                   Name="textBlock2value"
                   Text="{Binding Path=ValueIncubator.ValueNullableInt,FallbackValue='Value int?'}"
                   VerticalAlignment="Center" />
        <TextBlock Grid.Row="2"
                   Grid.Column="1"
                   Height="23"
                   HorizontalAlignment="Center"
                   Name="textBlock3value"
                   Text="{Binding Path=ValueIncubator.ValueDouble, FallbackValue='Value double'}"
                   VerticalAlignment="Center" />
        <TextBlock Grid.Row="3"
                   Grid.Column="1"
                   Height="23"
                   HorizontalAlignment="Center"
                   Name="textBlock4value"
                   Text="{Binding Path=ValueIncubator.ValueNullableDouble, FallbackValue='Value double?'}"
                   VerticalAlignment="Center" />

        <ilektrik:NullableNumericUpDown x:Name="nNUD1"
                                        Grid.Row="0"
                                        Grid.Column="2"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Stretch"
                                        Value="{Binding Path=ValueIncubator.ValueInt,Mode=TwoWay}">
            <ToolTipService.ToolTip>
                <ToolTip Content="To set null value on bound field erase the content of NUD and click somewhere (the control will lost its focus)"></ToolTip>
            </ToolTipService.ToolTip>
        </ilektrik:NullableNumericUpDown>
        <ilektrik:NullableNumericUpDown x:Name="nNUD2"
                                        Grid.Row="1"
                                        Grid.Column="2"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Stretch"
                                        Value="{Binding Path=ValueIncubator.ValueNullableInt,Mode=TwoWay}">
            <ToolTipService.ToolTip>
                <ToolTip Content="To set null value on bound field erase the content of NUD and click somewhere (the control will lost its focus)"></ToolTip>
            </ToolTipService.ToolTip>
        </ilektrik:NullableNumericUpDown>
        <ilektrik:NullableNumericUpDown x:Name="nNUD3"
                                        Grid.Row="2"
                                        Grid.Column="2"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Stretch"
                                        Value="{Binding Path=ValueIncubator.ValueDouble,Mode=TwoWay}">
            <ToolTipService.ToolTip>
                <ToolTip Content="To set null value on bound field erase the content of NUD and click somewhere (the control will lost its focus)"></ToolTip>
            </ToolTipService.ToolTip>
        </ilektrik:NullableNumericUpDown>
        <ilektrik:NullableNumericUpDown x:Name="nNUD4"
                                        Grid.Row="3"
                                        Grid.Column="2"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Stretch"
                                        Value="{Binding Path=ValueIncubator.ValueNullableDouble,Mode=TwoWay}">
            <ToolTipService.ToolTip>
                <ToolTip Content="To set null value on bound field erase the content of NUD and click somewhere (the control will lost its focus)"></ToolTip>
            </ToolTipService.ToolTip>
        </ilektrik:NullableNumericUpDown>

    </Grid>
</UserControl>
